{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###  建议使用jupyter notebook打开 并重新运行一次代码，方便数据的展示\n",
    "#### 为什么作业是pdf文档，jupyter只能保存为pdf或者html,手动滑稽"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 实验环境\n",
    "* deepin v20 beta  linux 5.3\n",
    "* sqlite数据库 \n",
    "* 数据库软件 DB Broswer for Sqlite，小巧好用，非常推荐 \n",
    "* Python 3.7 \n",
    "* selenium 务必装上相对应的driver，我是Linux chrome83.0.4103.97 \n",
    "* pyqt5\n",
    "* pyechart \n",
    "* 其他的一些工具 QtDesinger\n",
    "* 注意看有没有PyQtWebEngine,在这儿坑过，没有这个显示html会显示空白"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 基本的爬虫代码\n",
    "* 感谢James提供简答易爬的网址"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from selenium import webdriver"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取总共确诊人数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "时间 : 截止至2020年06月08日 09:35\n",
      "确诊 : 84634例\n",
      "疑似 : 1780例\n",
      "治愈 : 79865例\n",
      "重症 : 201例\n",
      "死亡 : 4645例\n"
     ]
    }
   ],
   "source": [
    "# 爬取网页地址\n",
    "url = \"http://zhongxinzhiyuan.cn/yiqing_real_time_map.html\"\n",
    "# 使用谷歌浏览器应用程序chromedriver.exe打开网页，需要自己修改chromedriver.exe所在的路径\n",
    "driver = webdriver.Chrome(\"./爬虫数据和database/chromedriver\")\n",
    "driver.get(url)\n",
    "# 根据ID爬取数据函数\n",
    "def getdata(id, id_cn):\n",
    "    try:\n",
    "        driver.find_element_by_id(id)  # F12按键，查到数据的id，爬取时间\n",
    "        print(id_cn,':',driver.find_element_by_id(id).text)\n",
    "    except:\n",
    "        print(id_cn,':','获取失败')\n",
    "\n",
    "dataid = ['timeline','diagnose','suspect','cure','serious','death']\n",
    "dataid_cn = ['时间','确诊','疑似','治愈','重症','死亡']\n",
    "\n",
    "# 开始尝试爬取数据\n",
    "for num in range(len(dataid)):\n",
    "    getdata(dataid[num],dataid_cn[num])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取国内确证情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "662\n",
      "1 香港 53 1106 1049 4\n",
      "2 四川省 20 581 558 3\n",
      "3 内蒙古自治区 16 235 218 1\n",
      "4 广东省 9 1602 1585 8\n",
      "5 上海市 7 678 664 7\n",
      "6 台湾 6 443 430 7\n",
      "7 山东省 4 792 781 7\n",
      "8 陕西省 3 311 305 3\n",
      "9 北京市 2 594 583 9\n",
      "10 福建省 2 359 356 1\n",
      "11 海南省 2 170 162 6\n",
      "12 天津市 1 193 189 3\n",
      "13 湖北省 0 68135 63623 4512\n",
      "14 河南省 0 1276 1254 22\n",
      "15 浙江省 0 1268 1267 1\n",
      "16 湖南省 0 1019 1015 4\n",
      "17 安徽省 0 991 985 6\n",
      "18 黑龙江省 0 947 934 13\n",
      "19 江西省 0 932 931 1\n",
      "20 江苏省 0 653 653 0\n",
      "21 重庆市 0 579 573 6\n",
      "22 河北省 0 328 322 6\n",
      "23 广西壮族自治区 0 254 252 2\n",
      "24 山西省 0 198 198 0\n",
      "25 云南省 0 185 183 2\n",
      "26 吉林省 0 155 153 2\n",
      "27 辽宁省 0 149 147 2\n",
      "28 贵州省 0 147 145 2\n",
      "29 甘肃省 0 139 137 2\n",
      "30 新疆维吾尔自治区 0 76 73 3\n",
      "31 宁夏回族自治区 0 75 75 0\n",
      "32 澳门 0 45 45 0\n",
      "33 青海省 0 18 18 0\n",
      "34 西藏自治区 0 1 1 0\n"
     ]
    }
   ],
   "source": [
    "def getdata_1(id):\n",
    "    try:\n",
    "        driver.find_element_by_id(id)\n",
    "        #print(driver.find_element_by_id(id).text)\n",
    "        text1 = driver.find_element_by_id(id).text\n",
    "        print(len(text1))\n",
    "        print(text1)\n",
    "        return text1\n",
    "    except:\n",
    "        print(id_cn,':','获取失败')\n",
    "\n",
    "dataid = ['table-provience']\n",
    "\n",
    "# 开始尝试爬取数据\n",
    "for num in range(len(dataid)):\n",
    "    text_china = getdata_1(dataid[num])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 获取全球确诊情况"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5170\n",
      "北美洲 美国 1322083 1938931 506367 110481\n",
      "南美洲 巴西 353379 691962 302084 36499\n",
      "欧洲 英国 245113 286194 539 40542\n",
      "欧洲 俄罗斯 235083 467673 226731 5859\n",
      "亚洲 印度 120406 246628 119293 6929\n",
      "南美洲 秘鲁 104831 196515 86219 5465\n",
      "南美洲 智利 87014 134150 44946 2190\n",
      "欧洲 西班牙 64038 241550 150376 27136\n",
      "亚洲 巴基斯坦 63476 98943 33465 2002\n",
      "欧洲 法国 53980 153977 70842 29155\n",
      "亚洲 孟加拉国 50958 65769 13923 888\n",
      "欧洲 意大利 35262 234998 165837 33899\n",
      "欧洲 瑞典 35185 44845 4971 4689\n",
      "南美洲 厄瓜多尔 35120 42728 4000 3608\n",
      "北美洲 加拿大 34285 95699 53614 7800\n",
      "欧洲 比利时 33340 59226 16291 9595\n",
      "欧洲 荷兰 29779 47574 11782 6013\n",
      "亚洲 伊朗 29149 171789 134349 8291\n",
      "亚洲 沙特阿拉伯 28385 101914 72817 712\n",
      "亚洲 土耳其 27471 170132 137969 4692\n",
      "欧洲 白俄罗斯 24714 48630 23647 269\n",
      "亚洲 卡塔尔 24398 68790 44338 54\n",
      "非洲 埃及 23881 34079 8961 1237\n",
      "非洲 南非 22923 48285 24364 998\n",
      "南美洲 哥伦比亚 22655 39236 15322 1259\n",
      "亚洲 印度尼西亚 18837 31186 10498 1851\n",
      "北美洲 墨西哥 18564 113619 81544 13511\n",
      "亚洲 阿富汗 18155 20342 1830 357\n",
      "亚洲 阿联酋 16726 38808 21806 276\n",
      "亚洲 菲律宾 16362 21895 4530 1003\n",
      "南美洲 阿根廷 16042 22794 6088 664\n",
      "欧洲 乌克兰 14157 26999 12054 788\n",
      "亚洲 阿曼 13356 16882 3451 75\n",
      "亚洲 新加坡 13326 37910 24559 25\n",
      "欧洲 波兰 12549 26561 12855 1157\n",
      "欧洲 葡萄牙 12219 34693 20995 1479\n",
      "南美洲 玻利维亚 12142 12728 159 427\n",
      "亚洲 科威特 11379 31848 20205 264\n",
      "亚洲 亚美尼亚 8916 13130 4014 200\n",
      "非洲 尼日利亚 8065 12233 3826 342\n",
      "亚洲 伊拉克 6834 12366 5186 346\n",
      "北美洲 多米尼加 6765 19220 11919 536\n",
      "北美洲 危地马拉 6269 6485 0 216\n",
      "欧洲 德国 6211 183979 169100 8668\n",
      "非洲 加纳 5958 9638 3636 44\n",
      "北美洲 洪都拉斯 5723 5971 0 248\n",
      "亚洲 哈萨克斯坦 5505 12694 7135 54\n",
      "北美洲 巴拿马 5500 16004 10118 386\n",
      "非洲 喀麦隆 5391 7599 1996 212\n",
      "亚洲 巴林 5270 14763 9468 25\n",
      "北美洲 波多黎各 4773 4915 0 142\n",
      "欧洲 罗马尼亚 4515 20479 14638 1326\n",
      "欧洲 摩尔多瓦 3936 9511 5240 335\n",
      "非洲 苏丹 3708 6081 2014 359\n",
      "非洲 刚果（金） 3393 4015 537 85\n",
      "亚洲 阿塞拜疆 3316 7553 4149 88\n",
      "亚洲 尼泊尔 2968 3448 467 13\n",
      "北美洲 萨尔瓦多 2881 2934 0 53\n",
      "北美洲 海地 2874 2924 0 50\n",
      "非洲 阿尔及利亚 2721 10050 6631 698\n",
      "亚洲 以色列 2474 17863 15091 298\n",
      "欧洲 捷克 2392 9609 6890 327\n",
      "非洲 吉布提 2302 4207 1877 28\n",
      "非洲 加蓬 2247 3101 833 21\n",
      "南美洲 委内瑞拉 2125 2145 0 20\n",
      "非洲 马约特 2054 2079 0 25\n",
      "非洲 科特迪瓦 1976 3557 1545 36\n",
      "非洲 肯尼亚 1931 2767 752 84\n",
      "亚洲 塔吉克斯坦 1914 4453 2491 48\n",
      "亚洲 日本 1880 17202 14406 916\n",
      "欧洲 芬兰 1842 6964 4800 322\n",
      "欧洲 保加利亚 1824 2711 727 160\n",
      "非洲 索马里 1801 2289 406 82\n",
      "欧洲 丹麦 1716 11948 9643 589\n",
      "非洲 塞内加尔 1690 4249 2512 47\n",
      "非洲 埃塞俄比亚 1649 2020 344 27\n",
      "非洲 中非共和国 1591 1634 38 5\n",
      "非洲 南苏丹 1575 1604 15 14\n",
      "北美洲 古巴 1565 2173 525 83\n",
      "亚洲 马来西亚 1531 8322 6674 117\n",
      "亚洲 乌兹别克斯坦 1528 4181 2636 17\n",
      "非洲 几内亚 1427 4117 2667 23\n",
      "欧洲 希腊 1299 2952 1473 180\n",
      "北美洲 尼加拉瓜 1263 1309 0 46\n",
      "北美洲 哥斯达黎加 1253 1263 0 10\n",
      "欧洲 北马其顿 1226 3025 1646 153\n",
      "非洲 几内亚比绍 1203 1368 153 12\n",
      "欧洲 奥地利 1199 16822 14951 672\n",
      "欧洲 匈牙利 1183 4008 2279 546\n",
      "亚洲 马尔代夫 1176 1901 717 8\n",
      "亚洲 吉尔吉斯斯坦 1005 2007 980 22\n",
      "亚洲 斯里兰卡 964 1814 839 11\n",
      "亚洲 韩国 951 11776 10552 273\n",
      "南美洲 巴拉圭 881 1090 198 11\n",
      "非洲 赤道几内亚 866 1043 165 12\n",
      "非洲 毛里塔尼亚 835 947 69 43\n",
      "非洲 马达加斯加 810 1052 233 9\n",
      "欧洲 爱尔兰 807 25183 22698 1678\n",
      "非洲 乍得 767 836 0 69\n",
      "非洲 塞拉利昂 693 946 205 48\n",
      "欧洲 塞尔维亚 687 12892 11927 278\n",
      "欧洲 瑞士 678 30883 28545 1660\n",
      "非洲 摩洛哥 665 8151 7278 208\n",
      "欧洲 圣马力诺 651 695 2 42\n",
      "非洲 乌干达 643 722 79 0\n",
      "南美洲 法属圭亚那 638 639 0 1\n",
      "非洲 马里 617 1523 816 90\n",
      "欧洲 拉脱维亚 597 1086 464 25\n",
      "欧洲 爱沙尼亚 587 1931 1275 69\n",
      "欧洲 立陶宛 585 1705 1049 71\n",
      "北美洲 牙买加 585 595 0 10\n",
      "亚洲 黎巴嫩 560 1320 731 29\n",
      "欧洲 波黑 517 2678 2003 158\n",
      "欧洲 阿尔巴尼亚 498 1246 714 34\n",
      "非洲 佛得角 493 542 44 5\n",
      "非洲 留尼旺 479 480 0 1\n",
      "大洋洲 澳大利亚 460 7255 6693 102\n",
      "非洲 刚果（布） 454 653 179 20\n",
      "亚洲 塞浦路斯 430 960 504 26\n",
      "非洲 圣多美和普林西比 378 458 68 12\n",
      "非洲 赞比亚共和国 368 1154 779 7\n",
      "非洲 多哥 367 487 107 13\n",
      "非洲 马拉维 350 409 55 4\n",
      "亚洲 也门共和国 348 486 26 112\n",
      "欧洲 安道尔 329 852 472 51\n",
      "非洲 坦桑尼亚 321 509 167 21\n",
      "欧洲 马恩岛 312 336 0 24\n",
      "非洲 莫桑比克 309 409 98 2\n",
      "非洲 斯威士兰 306 322 13 3\n",
      "欧洲 泽西岛 279 309 0 30\n",
      "欧洲 挪威 273 8510 7999 238\n",
      "非洲 贝宁 273 339 62 4\n",
      "亚洲 巴勒斯坦 261 643 377 5\n",
      "非洲 卢旺达 251 431 178 2\n",
      "欧洲 马耳他 246 622 367 9\n",
      "非洲 津巴布韦 242 279 33 4\n",
      "欧洲 根西岛 239 252 0 13\n",
      "非洲 利比里亚 230 345 85 30\n",
      "亚洲 约旦 215 795 571 9\n",
      "北美洲 马提尼克 188 202 0 14\n",
      "欧洲 法罗群岛 187 187 0 0\n",
      "非洲 布基纳法索 180 888 655 53\n",
      "非洲 利比亚 176 256 75 5\n",
      "欧洲 直布罗陀 173 174 0 1\n",
      "非洲 尼日尔 171 970 734 65\n",
      "亚洲 蒙古 169 193 24 0\n",
      "大洋洲 关岛 166 171 0 5\n",
      "亚洲 格鲁吉亚 162 809 634 13\n",
      "北美洲 开曼群岛 162 164 0 2\n",
      "北美洲 瓜德罗普岛 150 164 0 14\n",
      "欧洲 卢森堡 136 4035 3789 110\n",
      "欧洲 斯洛伐克 132 1528 1368 28\n",
      "北美洲 百慕大 132 141 0 9\n",
      "其他 钻石公主号邮轮 125 712 574 13\n",
      "亚洲 中国 124 84634 79865 4645\n",
      "欧洲 克罗地亚 116 2247 2027 104\n",
      "南美洲 圭亚那 114 153 27 12\n",
      "南美洲 乌拉圭 113 834 698 23\n",
      "北美洲 特立尼达和多巴哥 109 117 0 8\n",
      "亚洲 缅甸 104 240 130 6\n",
      "北美洲 阿鲁巴 98 101 0 3\n",
      "非洲 科摩罗 95 97 0 2\n",
      "欧洲 摩纳哥 93 99 3 3\n",
      "北美洲 巴哈马 92 103 0 11\n",
      "大洋洲 法属波利尼西亚 89 89 0 0\n",
      "北美洲 巴巴多斯 85 92 0 7\n",
      "南美洲 苏里南 83 90 6 1\n",
      "亚洲 泰国 82 3112 2972 58\n",
      "亚洲 叙利亚 78 125 41 6\n",
      "非洲 布隆迪共和国 78 83 4 1\n",
      "非洲 突尼斯 74 1087 964 49\n",
      "欧洲 斯洛文尼亚 66 1509 1335 108\n",
      "非洲 安哥拉 65 86 17 4\n",
      "北美洲 美属维尔京群岛 65 71 0 6\n",
      "北美洲 荷属圣马丁 63 78 0 15\n",
      "亚洲 越南 62 329 267 0\n",
      "亚洲 不丹 48 48 0 0\n",
      "欧洲 冰岛 41 1806 1755 10\n",
      "非洲 博茨瓦纳 39 40 0 1\n",
      "北美洲 圣马丁岛 38 41 0 3\n",
      "欧洲 列支敦士登 27 83 55 1\n",
      "非洲 纳米比亚 26 29 3 0\n",
      "北美洲 圣文森特和格林纳丁斯 26 26 0 0\n",
      "大洋洲 北马里亚纳群岛联邦 24 26 0 2\n",
      "亚洲 东帝汶 24 24 0 0\n",
      "非洲 冈比亚 23 26 2 1\n",
      "北美洲 格林那达 23 23 0 0\n",
      "北美洲 安提瓜和巴布达 22 25 0 3\n",
      "北美洲 库拉索岛 20 21 0 1\n",
      "大洋洲 新喀里多尼亚 20 20 0 0\n",
      "北美洲 圣卢西亚 19 19 0 0\n",
      "亚洲 老挝 19 19 0 0\n",
      "大洋洲 斐济 18 18 0 0\n",
      "北美洲 伯利兹 17 19 0 2\n",
      "北美洲 多米尼克 16 16 0 0\n",
      "北美洲 圣其茨和尼维斯 15 15 0 0\n",
      "北美洲 格陵兰 13 13 0 0\n",
      "南美洲 福克兰群岛 13 13 0 0\n",
      "欧洲 梵蒂冈 12 12 0 0\n",
      "北美洲 特克斯和凯科斯群岛 11 12 0 1\n",
      "非洲 塞舌尔 11 11 0 0\n",
      "北美洲 蒙特塞拉特 10 11 0 1\n",
      "亚洲 文莱 8 141 131 2\n",
      "大洋洲 巴布亚新几内亚 8 8 0 0\n",
      "北美洲 英属维尔京群岛 7 8 0 1\n",
      "南美洲 荷兰加勒比地区 7 7 0 0\n",
      "北美洲 圣巴泰勒米岛 6 6 0 0\n",
      "非洲 毛里求斯 5 337 322 10\n",
      "亚洲 柬埔寨 4 126 122 0\n",
      "非洲 莱索托 4 4 0 0\n",
      "北美洲 安圭拉 3 3 0 0\n",
      "非洲 厄立特里亚 2 41 39 0\n",
      "北美洲 圣皮埃尔和密克隆群岛 1 1 0 0\n",
      "欧洲 黑山 0 324 315 9\n",
      "大洋洲 新西兰 -215 1154 1347 22\n"
     ]
    }
   ],
   "source": [
    "dataid = ['table-tr']\n",
    "\n",
    "# 开始尝试爬取数据\n",
    "for num in range(len(dataid)):\n",
    "    text_global = getdata_1(dataid[num])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import json\n",
    "from pandas import json_normalize\n",
    "import pyecharts as pe\n",
    "from collections import Counter"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 桌面环境中加入html显示疫情地图，例子就像下面一样，在软件中也存了两张图，pyechart实现，具体见代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"d00e9cfa40d44759b227e2d9e339de42\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china'], function(echarts) {\n",
       "                var chart_d00e9cfa40d44759b227e2d9e339de42 = echarts.init(\n",
       "                    document.getElementById('d00e9cfa40d44759b227e2d9e339de42'), 'white', {renderer: 'canvas'});\n",
       "                var option_d00e9cfa40d44759b227e2d9e339de42 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"scatter\",\n",
       "            \"name\": \"geo\",\n",
       "            \"coordinateSystem\": \"geo\",\n",
       "            \"symbolSize\": 12,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        113.26653,\n",
       "                        23.132191,\n",
       "                        142\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        116.407526,\n",
       "                        39.90403,\n",
       "                        69\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u4e0a\\u6d77\",\n",
       "                    \"value\": [\n",
       "                        121.473701,\n",
       "                        31.230416,\n",
       "                        24\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        115.909228,\n",
       "                        28.675696,\n",
       "                        128\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5357\",\n",
       "                    \"value\": [\n",
       "                        112.98381,\n",
       "                        28.112444,\n",
       "                        41\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6d59\\u6c5f\",\n",
       "                    \"value\": [\n",
       "                        120.152791,\n",
       "                        30.267446,\n",
       "                        117\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u82cf\",\n",
       "                    \"value\": [\n",
       "                        118.763232,\n",
       "                        32.061707,\n",
       "                        81\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": false,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"geo\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"geo\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"formatter\": function (params) {        return params.name + ' : ' + params.value[2];    },\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"Pyechart-\\u57fa\\u672c\\u793a\\u4f8b\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 100,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#50a3ba\",\n",
       "                \"#eac763\",\n",
       "                \"#d94e5d\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    },\n",
       "    \"geo\": {\n",
       "        \"map\": \"china\",\n",
       "        \"roam\": true,\n",
       "        \"emphasis\": {}\n",
       "    }\n",
       "};\n",
       "                chart_d00e9cfa40d44759b227e2d9e339de42.setOption(option_d00e9cfa40d44759b227e2d9e339de42);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x7f3a8dc15d10>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from pyecharts.faker import Faker\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.charts import Geo\n",
    "from pyecharts.globals import ChartType, SymbolType\n",
    "\n",
    "\n",
    "g0 = Geo()\n",
    "g0.add_schema(maptype=\"china\")\n",
    "g0.add(\"geo\", [list(z) for z in zip(Faker.provinces, Faker.values())])\n",
    "g0.set_series_opts(label_opts=opts.LabelOpts(is_show=False))#去掉标识\n",
    "g0.set_global_opts(\n",
    "            visualmap_opts=opts.VisualMapOpts(is_piecewise=True),#显示坐下角的颜色控制\n",
    "            title_opts=opts.TitleOpts(title=\"Pyechart-基本示例\"),\n",
    "        )\n",
    "g0.render_notebook()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 先对数据进行简单的处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['1 香港 53 1106 1049 4',\n",
       " '2 四川省 20 581 558 3',\n",
       " '3 内蒙古自治区 16 235 218 1',\n",
       " '4 广东省 9 1602 1585 8',\n",
       " '5 上海市 7 678 664 7',\n",
       " '6 台湾 6 443 430 7',\n",
       " '7 山东省 4 792 781 7',\n",
       " '8 陕西省 3 311 305 3',\n",
       " '9 北京市 2 594 583 9',\n",
       " '10 福建省 2 359 356 1',\n",
       " '11 海南省 2 170 162 6',\n",
       " '12 天津市 1 193 189 3',\n",
       " '13 湖北省 0 68135 63623 4512',\n",
       " '14 河南省 0 1276 1254 22',\n",
       " '15 浙江省 0 1268 1267 1',\n",
       " '16 湖南省 0 1019 1015 4',\n",
       " '17 安徽省 0 991 985 6',\n",
       " '18 黑龙江省 0 947 934 13',\n",
       " '19 江西省 0 932 931 1',\n",
       " '20 江苏省 0 653 653 0',\n",
       " '21 重庆市 0 579 573 6',\n",
       " '22 河北省 0 328 322 6',\n",
       " '23 广西壮族自治区 0 254 252 2',\n",
       " '24 山西省 0 198 198 0',\n",
       " '25 云南省 0 185 183 2',\n",
       " '26 吉林省 0 155 153 2',\n",
       " '27 辽宁省 0 149 147 2',\n",
       " '28 贵州省 0 147 145 2',\n",
       " '29 甘肃省 0 139 137 2',\n",
       " '30 新疆维吾尔自治区 0 76 73 3',\n",
       " '31 宁夏回族自治区 0 75 75 0',\n",
       " '32 澳门 0 45 45 0',\n",
       " '33 青海省 0 18 18 0',\n",
       " '34 西藏自治区 0 1 1 0']"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#先对数据进行简单的处理\n",
    "temp1 = text_china.split(\"\\n\")\n",
    "temp1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#同上\n",
    "temp_China =[]\n",
    "for i in temp1:\n",
    "    temp_China.append(i.split())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['1', '香港', '53', '1106', '1049', '4'],\n",
       " ['2', '四川省', '20', '581', '558', '3'],\n",
       " ['3', '内蒙古自治区', '16', '235', '218', '1'],\n",
       " ['4', '广东省', '9', '1602', '1585', '8'],\n",
       " ['5', '上海市', '7', '678', '664', '7'],\n",
       " ['6', '台湾', '6', '443', '430', '7'],\n",
       " ['7', '山东省', '4', '792', '781', '7'],\n",
       " ['8', '陕西省', '3', '311', '305', '3'],\n",
       " ['9', '北京市', '2', '594', '583', '9'],\n",
       " ['10', '福建省', '2', '359', '356', '1'],\n",
       " ['11', '海南省', '2', '170', '162', '6'],\n",
       " ['12', '天津市', '1', '193', '189', '3'],\n",
       " ['13', '湖北省', '0', '68135', '63623', '4512'],\n",
       " ['14', '河南省', '0', '1276', '1254', '22'],\n",
       " ['15', '浙江省', '0', '1268', '1267', '1'],\n",
       " ['16', '湖南省', '0', '1019', '1015', '4'],\n",
       " ['17', '安徽省', '0', '991', '985', '6'],\n",
       " ['18', '黑龙江省', '0', '947', '934', '13'],\n",
       " ['19', '江西省', '0', '932', '931', '1'],\n",
       " ['20', '江苏省', '0', '653', '653', '0'],\n",
       " ['21', '重庆市', '0', '579', '573', '6'],\n",
       " ['22', '河北省', '0', '328', '322', '6'],\n",
       " ['23', '广西壮族自治区', '0', '254', '252', '2'],\n",
       " ['24', '山西省', '0', '198', '198', '0'],\n",
       " ['25', '云南省', '0', '185', '183', '2'],\n",
       " ['26', '吉林省', '0', '155', '153', '2'],\n",
       " ['27', '辽宁省', '0', '149', '147', '2'],\n",
       " ['28', '贵州省', '0', '147', '145', '2'],\n",
       " ['29', '甘肃省', '0', '139', '137', '2'],\n",
       " ['30', '新疆维吾尔自治区', '0', '76', '73', '3'],\n",
       " ['31', '宁夏回族自治区', '0', '75', '75', '0'],\n",
       " ['32', '澳门', '0', '45', '45', '0'],\n",
       " ['33', '青海省', '0', '18', '18', '0'],\n",
       " ['34', '西藏自治区', '0', '1', '1', '0']]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp_China"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 利用pandas处理数据，"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>省份</th>\n",
       "      <th>现存确诊</th>\n",
       "      <th>累计确诊</th>\n",
       "      <th>治愈</th>\n",
       "      <th>死亡</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>香港</td>\n",
       "      <td>53</td>\n",
       "      <td>1106</td>\n",
       "      <td>1049</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>四川省</td>\n",
       "      <td>20</td>\n",
       "      <td>581</td>\n",
       "      <td>558</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>内蒙古自治区</td>\n",
       "      <td>16</td>\n",
       "      <td>235</td>\n",
       "      <td>218</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>广东省</td>\n",
       "      <td>9</td>\n",
       "      <td>1602</td>\n",
       "      <td>1585</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>上海市</td>\n",
       "      <td>7</td>\n",
       "      <td>678</td>\n",
       "      <td>664</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>台湾</td>\n",
       "      <td>6</td>\n",
       "      <td>443</td>\n",
       "      <td>430</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>山东省</td>\n",
       "      <td>4</td>\n",
       "      <td>792</td>\n",
       "      <td>781</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>陕西省</td>\n",
       "      <td>3</td>\n",
       "      <td>311</td>\n",
       "      <td>305</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>北京市</td>\n",
       "      <td>2</td>\n",
       "      <td>594</td>\n",
       "      <td>583</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>福建省</td>\n",
       "      <td>2</td>\n",
       "      <td>359</td>\n",
       "      <td>356</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>海南省</td>\n",
       "      <td>2</td>\n",
       "      <td>170</td>\n",
       "      <td>162</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>天津市</td>\n",
       "      <td>1</td>\n",
       "      <td>193</td>\n",
       "      <td>189</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>湖北省</td>\n",
       "      <td>0</td>\n",
       "      <td>68135</td>\n",
       "      <td>63623</td>\n",
       "      <td>4512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>河南省</td>\n",
       "      <td>0</td>\n",
       "      <td>1276</td>\n",
       "      <td>1254</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>浙江省</td>\n",
       "      <td>0</td>\n",
       "      <td>1268</td>\n",
       "      <td>1267</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>湖南省</td>\n",
       "      <td>0</td>\n",
       "      <td>1019</td>\n",
       "      <td>1015</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>安徽省</td>\n",
       "      <td>0</td>\n",
       "      <td>991</td>\n",
       "      <td>985</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>黑龙江省</td>\n",
       "      <td>0</td>\n",
       "      <td>947</td>\n",
       "      <td>934</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>江西省</td>\n",
       "      <td>0</td>\n",
       "      <td>932</td>\n",
       "      <td>931</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>江苏省</td>\n",
       "      <td>0</td>\n",
       "      <td>653</td>\n",
       "      <td>653</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>重庆市</td>\n",
       "      <td>0</td>\n",
       "      <td>579</td>\n",
       "      <td>573</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>河北省</td>\n",
       "      <td>0</td>\n",
       "      <td>328</td>\n",
       "      <td>322</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>广西壮族自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>254</td>\n",
       "      <td>252</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>山西省</td>\n",
       "      <td>0</td>\n",
       "      <td>198</td>\n",
       "      <td>198</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>云南省</td>\n",
       "      <td>0</td>\n",
       "      <td>185</td>\n",
       "      <td>183</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>吉林省</td>\n",
       "      <td>0</td>\n",
       "      <td>155</td>\n",
       "      <td>153</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>辽宁省</td>\n",
       "      <td>0</td>\n",
       "      <td>149</td>\n",
       "      <td>147</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>贵州省</td>\n",
       "      <td>0</td>\n",
       "      <td>147</td>\n",
       "      <td>145</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>甘肃省</td>\n",
       "      <td>0</td>\n",
       "      <td>139</td>\n",
       "      <td>137</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>新疆维吾尔自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>76</td>\n",
       "      <td>73</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>宁夏回族自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>75</td>\n",
       "      <td>75</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>澳门</td>\n",
       "      <td>0</td>\n",
       "      <td>45</td>\n",
       "      <td>45</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>青海省</td>\n",
       "      <td>0</td>\n",
       "      <td>18</td>\n",
       "      <td>18</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>西藏自治区</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          省份 现存确诊   累计确诊     治愈    死亡\n",
       "0         香港   53   1106   1049     4\n",
       "1        四川省   20    581    558     3\n",
       "2     内蒙古自治区   16    235    218     1\n",
       "3        广东省    9   1602   1585     8\n",
       "4        上海市    7    678    664     7\n",
       "5         台湾    6    443    430     7\n",
       "6        山东省    4    792    781     7\n",
       "7        陕西省    3    311    305     3\n",
       "8        北京市    2    594    583     9\n",
       "9        福建省    2    359    356     1\n",
       "10       海南省    2    170    162     6\n",
       "11       天津市    1    193    189     3\n",
       "12       湖北省    0  68135  63623  4512\n",
       "13       河南省    0   1276   1254    22\n",
       "14       浙江省    0   1268   1267     1\n",
       "15       湖南省    0   1019   1015     4\n",
       "16       安徽省    0    991    985     6\n",
       "17      黑龙江省    0    947    934    13\n",
       "18       江西省    0    932    931     1\n",
       "19       江苏省    0    653    653     0\n",
       "20       重庆市    0    579    573     6\n",
       "21       河北省    0    328    322     6\n",
       "22   广西壮族自治区    0    254    252     2\n",
       "23       山西省    0    198    198     0\n",
       "24       云南省    0    185    183     2\n",
       "25       吉林省    0    155    153     2\n",
       "26       辽宁省    0    149    147     2\n",
       "27       贵州省    0    147    145     2\n",
       "28       甘肃省    0    139    137     2\n",
       "29  新疆维吾尔自治区    0     76     73     3\n",
       "30   宁夏回族自治区    0     75     75     0\n",
       "31        澳门    0     45     45     0\n",
       "32       青海省    0     18     18     0\n",
       "33     西藏自治区    0      1      1     0"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a=pd.DataFrame(temp_China,columns = [\"序号\",'省份','现存确诊','累计确诊','治愈','死亡'] )\n",
    "China = a.iloc[:,1:]\n",
    "China"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[['北美洲', '美国', '1322083', '1938931', '506367', '110481'],\n",
       " ['南美洲', '巴西', '353379', '691962', '302084', '36499'],\n",
       " ['欧洲', '英国', '245113', '286194', '539', '40542'],\n",
       " ['欧洲', '俄罗斯', '235083', '467673', '226731', '5859'],\n",
       " ['亚洲', '印度', '120406', '246628', '119293', '6929'],\n",
       " ['南美洲', '秘鲁', '104831', '196515', '86219', '5465'],\n",
       " ['南美洲', '智利', '87014', '134150', '44946', '2190'],\n",
       " ['欧洲', '西班牙', '64038', '241550', '150376', '27136'],\n",
       " ['亚洲', '巴基斯坦', '63476', '98943', '33465', '2002'],\n",
       " ['欧洲', '法国', '53980', '153977', '70842', '29155'],\n",
       " ['亚洲', '孟加拉国', '50958', '65769', '13923', '888'],\n",
       " ['欧洲', '意大利', '35262', '234998', '165837', '33899'],\n",
       " ['欧洲', '瑞典', '35185', '44845', '4971', '4689'],\n",
       " ['南美洲', '厄瓜多尔', '35120', '42728', '4000', '3608'],\n",
       " ['北美洲', '加拿大', '34285', '95699', '53614', '7800'],\n",
       " ['欧洲', '比利时', '33340', '59226', '16291', '9595'],\n",
       " ['欧洲', '荷兰', '29779', '47574', '11782', '6013'],\n",
       " ['亚洲', '伊朗', '29149', '171789', '134349', '8291'],\n",
       " ['亚洲', '沙特阿拉伯', '28385', '101914', '72817', '712'],\n",
       " ['亚洲', '土耳其', '27471', '170132', '137969', '4692'],\n",
       " ['欧洲', '白俄罗斯', '24714', '48630', '23647', '269'],\n",
       " ['亚洲', '卡塔尔', '24398', '68790', '44338', '54'],\n",
       " ['非洲', '埃及', '23881', '34079', '8961', '1237'],\n",
       " ['非洲', '南非', '22923', '48285', '24364', '998'],\n",
       " ['南美洲', '哥伦比亚', '22655', '39236', '15322', '1259'],\n",
       " ['亚洲', '印度尼西亚', '18837', '31186', '10498', '1851'],\n",
       " ['北美洲', '墨西哥', '18564', '113619', '81544', '13511'],\n",
       " ['亚洲', '阿富汗', '18155', '20342', '1830', '357'],\n",
       " ['亚洲', '阿联酋', '16726', '38808', '21806', '276'],\n",
       " ['亚洲', '菲律宾', '16362', '21895', '4530', '1003'],\n",
       " ['南美洲', '阿根廷', '16042', '22794', '6088', '664'],\n",
       " ['欧洲', '乌克兰', '14157', '26999', '12054', '788'],\n",
       " ['亚洲', '阿曼', '13356', '16882', '3451', '75'],\n",
       " ['亚洲', '新加坡', '13326', '37910', '24559', '25'],\n",
       " ['欧洲', '波兰', '12549', '26561', '12855', '1157'],\n",
       " ['欧洲', '葡萄牙', '12219', '34693', '20995', '1479'],\n",
       " ['南美洲', '玻利维亚', '12142', '12728', '159', '427'],\n",
       " ['亚洲', '科威特', '11379', '31848', '20205', '264'],\n",
       " ['亚洲', '亚美尼亚', '8916', '13130', '4014', '200'],\n",
       " ['非洲', '尼日利亚', '8065', '12233', '3826', '342'],\n",
       " ['亚洲', '伊拉克', '6834', '12366', '5186', '346'],\n",
       " ['北美洲', '多米尼加', '6765', '19220', '11919', '536'],\n",
       " ['北美洲', '危地马拉', '6269', '6485', '0', '216'],\n",
       " ['欧洲', '德国', '6211', '183979', '169100', '8668'],\n",
       " ['非洲', '加纳', '5958', '9638', '3636', '44'],\n",
       " ['北美洲', '洪都拉斯', '5723', '5971', '0', '248'],\n",
       " ['亚洲', '哈萨克斯坦', '5505', '12694', '7135', '54'],\n",
       " ['北美洲', '巴拿马', '5500', '16004', '10118', '386'],\n",
       " ['非洲', '喀麦隆', '5391', '7599', '1996', '212'],\n",
       " ['亚洲', '巴林', '5270', '14763', '9468', '25'],\n",
       " ['北美洲', '波多黎各', '4773', '4915', '0', '142'],\n",
       " ['欧洲', '罗马尼亚', '4515', '20479', '14638', '1326'],\n",
       " ['欧洲', '摩尔多瓦', '3936', '9511', '5240', '335'],\n",
       " ['非洲', '苏丹', '3708', '6081', '2014', '359'],\n",
       " ['非洲', '刚果（金）', '3393', '4015', '537', '85'],\n",
       " ['亚洲', '阿塞拜疆', '3316', '7553', '4149', '88'],\n",
       " ['亚洲', '尼泊尔', '2968', '3448', '467', '13'],\n",
       " ['北美洲', '萨尔瓦多', '2881', '2934', '0', '53'],\n",
       " ['北美洲', '海地', '2874', '2924', '0', '50'],\n",
       " ['非洲', '阿尔及利亚', '2721', '10050', '6631', '698'],\n",
       " ['亚洲', '以色列', '2474', '17863', '15091', '298'],\n",
       " ['欧洲', '捷克', '2392', '9609', '6890', '327'],\n",
       " ['非洲', '吉布提', '2302', '4207', '1877', '28'],\n",
       " ['非洲', '加蓬', '2247', '3101', '833', '21'],\n",
       " ['南美洲', '委内瑞拉', '2125', '2145', '0', '20'],\n",
       " ['非洲', '马约特', '2054', '2079', '0', '25'],\n",
       " ['非洲', '科特迪瓦', '1976', '3557', '1545', '36'],\n",
       " ['非洲', '肯尼亚', '1931', '2767', '752', '84'],\n",
       " ['亚洲', '塔吉克斯坦', '1914', '4453', '2491', '48'],\n",
       " ['亚洲', '日本', '1880', '17202', '14406', '916'],\n",
       " ['欧洲', '芬兰', '1842', '6964', '4800', '322'],\n",
       " ['欧洲', '保加利亚', '1824', '2711', '727', '160'],\n",
       " ['非洲', '索马里', '1801', '2289', '406', '82'],\n",
       " ['欧洲', '丹麦', '1716', '11948', '9643', '589'],\n",
       " ['非洲', '塞内加尔', '1690', '4249', '2512', '47'],\n",
       " ['非洲', '埃塞俄比亚', '1649', '2020', '344', '27'],\n",
       " ['非洲', '中非共和国', '1591', '1634', '38', '5'],\n",
       " ['非洲', '南苏丹', '1575', '1604', '15', '14'],\n",
       " ['北美洲', '古巴', '1565', '2173', '525', '83'],\n",
       " ['亚洲', '马来西亚', '1531', '8322', '6674', '117'],\n",
       " ['亚洲', '乌兹别克斯坦', '1528', '4181', '2636', '17'],\n",
       " ['非洲', '几内亚', '1427', '4117', '2667', '23'],\n",
       " ['欧洲', '希腊', '1299', '2952', '1473', '180'],\n",
       " ['北美洲', '尼加拉瓜', '1263', '1309', '0', '46'],\n",
       " ['北美洲', '哥斯达黎加', '1253', '1263', '0', '10'],\n",
       " ['欧洲', '北马其顿', '1226', '3025', '1646', '153'],\n",
       " ['非洲', '几内亚比绍', '1203', '1368', '153', '12'],\n",
       " ['欧洲', '奥地利', '1199', '16822', '14951', '672'],\n",
       " ['欧洲', '匈牙利', '1183', '4008', '2279', '546'],\n",
       " ['亚洲', '马尔代夫', '1176', '1901', '717', '8'],\n",
       " ['亚洲', '吉尔吉斯斯坦', '1005', '2007', '980', '22'],\n",
       " ['亚洲', '斯里兰卡', '964', '1814', '839', '11'],\n",
       " ['亚洲', '韩国', '951', '11776', '10552', '273'],\n",
       " ['南美洲', '巴拉圭', '881', '1090', '198', '11'],\n",
       " ['非洲', '赤道几内亚', '866', '1043', '165', '12'],\n",
       " ['非洲', '毛里塔尼亚', '835', '947', '69', '43'],\n",
       " ['非洲', '马达加斯加', '810', '1052', '233', '9'],\n",
       " ['欧洲', '爱尔兰', '807', '25183', '22698', '1678'],\n",
       " ['非洲', '乍得', '767', '836', '0', '69'],\n",
       " ['非洲', '塞拉利昂', '693', '946', '205', '48'],\n",
       " ['欧洲', '塞尔维亚', '687', '12892', '11927', '278'],\n",
       " ['欧洲', '瑞士', '678', '30883', '28545', '1660'],\n",
       " ['非洲', '摩洛哥', '665', '8151', '7278', '208'],\n",
       " ['欧洲', '圣马力诺', '651', '695', '2', '42'],\n",
       " ['非洲', '乌干达', '643', '722', '79', '0'],\n",
       " ['南美洲', '法属圭亚那', '638', '639', '0', '1'],\n",
       " ['非洲', '马里', '617', '1523', '816', '90'],\n",
       " ['欧洲', '拉脱维亚', '597', '1086', '464', '25'],\n",
       " ['欧洲', '爱沙尼亚', '587', '1931', '1275', '69'],\n",
       " ['欧洲', '立陶宛', '585', '1705', '1049', '71'],\n",
       " ['北美洲', '牙买加', '585', '595', '0', '10'],\n",
       " ['亚洲', '黎巴嫩', '560', '1320', '731', '29'],\n",
       " ['欧洲', '波黑', '517', '2678', '2003', '158'],\n",
       " ['欧洲', '阿尔巴尼亚', '498', '1246', '714', '34'],\n",
       " ['非洲', '佛得角', '493', '542', '44', '5'],\n",
       " ['非洲', '留尼旺', '479', '480', '0', '1'],\n",
       " ['大洋洲', '澳大利亚', '460', '7255', '6693', '102'],\n",
       " ['非洲', '刚果（布）', '454', '653', '179', '20'],\n",
       " ['亚洲', '塞浦路斯', '430', '960', '504', '26'],\n",
       " ['非洲', '圣多美和普林西比', '378', '458', '68', '12'],\n",
       " ['非洲', '赞比亚共和国', '368', '1154', '779', '7'],\n",
       " ['非洲', '多哥', '367', '487', '107', '13'],\n",
       " ['非洲', '马拉维', '350', '409', '55', '4'],\n",
       " ['亚洲', '也门共和国', '348', '486', '26', '112'],\n",
       " ['欧洲', '安道尔', '329', '852', '472', '51'],\n",
       " ['非洲', '坦桑尼亚', '321', '509', '167', '21'],\n",
       " ['欧洲', '马恩岛', '312', '336', '0', '24'],\n",
       " ['非洲', '莫桑比克', '309', '409', '98', '2'],\n",
       " ['非洲', '斯威士兰', '306', '322', '13', '3'],\n",
       " ['欧洲', '泽西岛', '279', '309', '0', '30'],\n",
       " ['欧洲', '挪威', '273', '8510', '7999', '238'],\n",
       " ['非洲', '贝宁', '273', '339', '62', '4'],\n",
       " ['亚洲', '巴勒斯坦', '261', '643', '377', '5'],\n",
       " ['非洲', '卢旺达', '251', '431', '178', '2'],\n",
       " ['欧洲', '马耳他', '246', '622', '367', '9'],\n",
       " ['非洲', '津巴布韦', '242', '279', '33', '4'],\n",
       " ['欧洲', '根西岛', '239', '252', '0', '13'],\n",
       " ['非洲', '利比里亚', '230', '345', '85', '30'],\n",
       " ['亚洲', '约旦', '215', '795', '571', '9'],\n",
       " ['北美洲', '马提尼克', '188', '202', '0', '14'],\n",
       " ['欧洲', '法罗群岛', '187', '187', '0', '0'],\n",
       " ['非洲', '布基纳法索', '180', '888', '655', '53'],\n",
       " ['非洲', '利比亚', '176', '256', '75', '5'],\n",
       " ['欧洲', '直布罗陀', '173', '174', '0', '1'],\n",
       " ['非洲', '尼日尔', '171', '970', '734', '65'],\n",
       " ['亚洲', '蒙古', '169', '193', '24', '0'],\n",
       " ['大洋洲', '关岛', '166', '171', '0', '5'],\n",
       " ['亚洲', '格鲁吉亚', '162', '809', '634', '13'],\n",
       " ['北美洲', '开曼群岛', '162', '164', '0', '2'],\n",
       " ['北美洲', '瓜德罗普岛', '150', '164', '0', '14'],\n",
       " ['欧洲', '卢森堡', '136', '4035', '3789', '110'],\n",
       " ['欧洲', '斯洛伐克', '132', '1528', '1368', '28'],\n",
       " ['北美洲', '百慕大', '132', '141', '0', '9'],\n",
       " ['其他', '钻石公主号邮轮', '125', '712', '574', '13'],\n",
       " ['亚洲', '中国', '124', '84634', '79865', '4645'],\n",
       " ['欧洲', '克罗地亚', '116', '2247', '2027', '104'],\n",
       " ['南美洲', '圭亚那', '114', '153', '27', '12'],\n",
       " ['南美洲', '乌拉圭', '113', '834', '698', '23'],\n",
       " ['北美洲', '特立尼达和多巴哥', '109', '117', '0', '8'],\n",
       " ['亚洲', '缅甸', '104', '240', '130', '6'],\n",
       " ['北美洲', '阿鲁巴', '98', '101', '0', '3'],\n",
       " ['非洲', '科摩罗', '95', '97', '0', '2'],\n",
       " ['欧洲', '摩纳哥', '93', '99', '3', '3'],\n",
       " ['北美洲', '巴哈马', '92', '103', '0', '11'],\n",
       " ['大洋洲', '法属波利尼西亚', '89', '89', '0', '0'],\n",
       " ['北美洲', '巴巴多斯', '85', '92', '0', '7'],\n",
       " ['南美洲', '苏里南', '83', '90', '6', '1'],\n",
       " ['亚洲', '泰国', '82', '3112', '2972', '58'],\n",
       " ['亚洲', '叙利亚', '78', '125', '41', '6'],\n",
       " ['非洲', '布隆迪共和国', '78', '83', '4', '1'],\n",
       " ['非洲', '突尼斯', '74', '1087', '964', '49'],\n",
       " ['欧洲', '斯洛文尼亚', '66', '1509', '1335', '108'],\n",
       " ['非洲', '安哥拉', '65', '86', '17', '4'],\n",
       " ['北美洲', '美属维尔京群岛', '65', '71', '0', '6'],\n",
       " ['北美洲', '荷属圣马丁', '63', '78', '0', '15'],\n",
       " ['亚洲', '越南', '62', '329', '267', '0'],\n",
       " ['亚洲', '不丹', '48', '48', '0', '0'],\n",
       " ['欧洲', '冰岛', '41', '1806', '1755', '10'],\n",
       " ['非洲', '博茨瓦纳', '39', '40', '0', '1'],\n",
       " ['北美洲', '圣马丁岛', '38', '41', '0', '3'],\n",
       " ['欧洲', '列支敦士登', '27', '83', '55', '1'],\n",
       " ['非洲', '纳米比亚', '26', '29', '3', '0'],\n",
       " ['北美洲', '圣文森特和格林纳丁斯', '26', '26', '0', '0'],\n",
       " ['大洋洲', '北马里亚纳群岛联邦', '24', '26', '0', '2'],\n",
       " ['亚洲', '东帝汶', '24', '24', '0', '0'],\n",
       " ['非洲', '冈比亚', '23', '26', '2', '1'],\n",
       " ['北美洲', '格林那达', '23', '23', '0', '0'],\n",
       " ['北美洲', '安提瓜和巴布达', '22', '25', '0', '3'],\n",
       " ['北美洲', '库拉索岛', '20', '21', '0', '1'],\n",
       " ['大洋洲', '新喀里多尼亚', '20', '20', '0', '0'],\n",
       " ['北美洲', '圣卢西亚', '19', '19', '0', '0'],\n",
       " ['亚洲', '老挝', '19', '19', '0', '0'],\n",
       " ['大洋洲', '斐济', '18', '18', '0', '0'],\n",
       " ['北美洲', '伯利兹', '17', '19', '0', '2'],\n",
       " ['北美洲', '多米尼克', '16', '16', '0', '0'],\n",
       " ['北美洲', '圣其茨和尼维斯', '15', '15', '0', '0'],\n",
       " ['北美洲', '格陵兰', '13', '13', '0', '0'],\n",
       " ['南美洲', '福克兰群岛', '13', '13', '0', '0'],\n",
       " ['欧洲', '梵蒂冈', '12', '12', '0', '0'],\n",
       " ['北美洲', '特克斯和凯科斯群岛', '11', '12', '0', '1'],\n",
       " ['非洲', '塞舌尔', '11', '11', '0', '0'],\n",
       " ['北美洲', '蒙特塞拉特', '10', '11', '0', '1'],\n",
       " ['亚洲', '文莱', '8', '141', '131', '2'],\n",
       " ['大洋洲', '巴布亚新几内亚', '8', '8', '0', '0'],\n",
       " ['北美洲', '英属维尔京群岛', '7', '8', '0', '1'],\n",
       " ['南美洲', '荷兰加勒比地区', '7', '7', '0', '0'],\n",
       " ['北美洲', '圣巴泰勒米岛', '6', '6', '0', '0'],\n",
       " ['非洲', '毛里求斯', '5', '337', '322', '10'],\n",
       " ['亚洲', '柬埔寨', '4', '126', '122', '0'],\n",
       " ['非洲', '莱索托', '4', '4', '0', '0'],\n",
       " ['北美洲', '安圭拉', '3', '3', '0', '0'],\n",
       " ['非洲', '厄立特里亚', '2', '41', '39', '0'],\n",
       " ['北美洲', '圣皮埃尔和密克隆群岛', '1', '1', '0', '0'],\n",
       " ['欧洲', '黑山', '0', '324', '315', '9'],\n",
       " ['大洋洲', '新西兰', '-215', '1154', '1347', '22']]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "temp1 = text_global.split(\"\\n\")\n",
    "temp_global =[]\n",
    "for i in temp1:\n",
    "    temp_global.append(i.split())\n",
    "temp_global"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>大陆</th>\n",
       "      <th>国家</th>\n",
       "      <th>现存确诊</th>\n",
       "      <th>累计确诊</th>\n",
       "      <th>治愈</th>\n",
       "      <th>死亡</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>北美洲</td>\n",
       "      <td>美国</td>\n",
       "      <td>1322083</td>\n",
       "      <td>1938931</td>\n",
       "      <td>506367</td>\n",
       "      <td>110481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>南美洲</td>\n",
       "      <td>巴西</td>\n",
       "      <td>353379</td>\n",
       "      <td>691962</td>\n",
       "      <td>302084</td>\n",
       "      <td>36499</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>欧洲</td>\n",
       "      <td>英国</td>\n",
       "      <td>245113</td>\n",
       "      <td>286194</td>\n",
       "      <td>539</td>\n",
       "      <td>40542</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>欧洲</td>\n",
       "      <td>俄罗斯</td>\n",
       "      <td>235083</td>\n",
       "      <td>467673</td>\n",
       "      <td>226731</td>\n",
       "      <td>5859</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>亚洲</td>\n",
       "      <td>印度</td>\n",
       "      <td>120406</td>\n",
       "      <td>246628</td>\n",
       "      <td>119293</td>\n",
       "      <td>6929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>210</th>\n",
       "      <td>北美洲</td>\n",
       "      <td>安圭拉</td>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>211</th>\n",
       "      <td>非洲</td>\n",
       "      <td>厄立特里亚</td>\n",
       "      <td>2</td>\n",
       "      <td>41</td>\n",
       "      <td>39</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>212</th>\n",
       "      <td>北美洲</td>\n",
       "      <td>圣皮埃尔和密克隆群岛</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>213</th>\n",
       "      <td>欧洲</td>\n",
       "      <td>黑山</td>\n",
       "      <td>0</td>\n",
       "      <td>324</td>\n",
       "      <td>315</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>214</th>\n",
       "      <td>大洋洲</td>\n",
       "      <td>新西兰</td>\n",
       "      <td>-215</td>\n",
       "      <td>1154</td>\n",
       "      <td>1347</td>\n",
       "      <td>22</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>215 rows × 6 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      大陆          国家     现存确诊     累计确诊      治愈      死亡\n",
       "0    北美洲          美国  1322083  1938931  506367  110481\n",
       "1    南美洲          巴西   353379   691962  302084   36499\n",
       "2     欧洲          英国   245113   286194     539   40542\n",
       "3     欧洲         俄罗斯   235083   467673  226731    5859\n",
       "4     亚洲          印度   120406   246628  119293    6929\n",
       "..   ...         ...      ...      ...     ...     ...\n",
       "210  北美洲         安圭拉        3        3       0       0\n",
       "211   非洲       厄立特里亚        2       41      39       0\n",
       "212  北美洲  圣皮埃尔和密克隆群岛        1        1       0       0\n",
       "213   欧洲          黑山        0      324     315       9\n",
       "214  大洋洲         新西兰     -215     1154    1347      22\n",
       "\n",
       "[215 rows x 6 columns]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Global=pd.DataFrame(temp_global,columns = [\"大陆\",'国家','现存确诊','累计确诊','治愈','死亡'] )\n",
    "Global"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 存储进入数据库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import sqlite3\n",
    "\n",
    "# query = \"\"\"\n",
    "#         CREATE TABLE test\n",
    "#         (a VARCHAR(20), b VARCHAR(20),\n",
    "#         c REAL, d INTEGER);\n",
    "# \"\"\"\n",
    "\n",
    "# con = sqlite3.connect(\"test.db\")\n",
    "# print(con.execute(query))\n",
    "# con.commit()\n",
    "# # 使用SQL INSERT语句插入数据\n",
    "\n",
    "# data = [('white', 'up', 1, 3),\n",
    "#         ('black', 'down', 2, 8),\n",
    "#         ('green', 'up', 4, 4),\n",
    "#         ('red', 'down', 5, 5)]\n",
    "# stmt = \"INSERT INTO test VALUES(?,?,?,?)\"\n",
    "# print(con.executemany(stmt, data))\n",
    "# con.commit()\n",
    "# print(data)\n",
    "\n",
    "#这种方式写入数据库太低端了"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 来个高级一点的 Sqlalchemy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from sqlalchemy import create_engine\n",
    "#利用pandas自带的和sqlite交互包，方便快捷\n",
    "engine= create_engine('sqlite:///test.db')\n",
    "China.to_sql('China', engine,if_exists='replace',index = False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "#利用pandas自带的和sqlite交互包，方便快捷\n",
    "Global.to_sql('Global', engine,if_exists='replace',index = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### China数据已经写入数据库，看下图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src='./爬虫数据和database/China.png', width=80%>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src='./爬虫数据和database/China.png', width=80%>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Global也在这儿"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src='./爬虫数据和database/Global.png', width=80%>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src='./爬虫数据和database/Global.png', width=80%>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 可视化展示\n",
    "* 代码中有实现，结果在文件夹中的HTML文件，可用浏览器查看"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 体温管理系统"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 也只是简单的实现"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<img src='./爬虫数据和database/个人体温.png', width=80%>\n",
       "#里面的数据都是可以直接点击修改的，\n",
       "#使用前点击查看所有，才会显示人员信息，删除所有需要超管权限（注意与管理员权限不同），超管（超级管理员）就是作者我啦\n",
       "# 添加用户管理都是可以的，但是管理员不能干涉其他管理员，超管可以随时删除管理员，超管密码在数据库admin中存储（已经hash加密过）\n",
       "# 可以尝试破解一下，算了密码是 超管名称ymy   密码yemingyu  ,其他管理员名称和密码一样 例如 111 222 都是管理员\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%html\n",
    "<img src='./爬虫数据和database/个人体温.png', width=80%>\n",
    "#里面的数据都是可以直接点击修改的，\n",
    "#使用前点击查看所有，才会显示人员信息，删除所有需要超管权限（注意与管理员权限不同），超管（超级管理员）就是作者我啦\n",
    "# 添加用户管理都是可以的，但是管理员不能干涉其他管理员，超管可以随时删除管理员，超管密码在数据库admin中存储（已经hash加密过）\n",
    "# 可以尝试破解一下，算了密码是 超管名称ymy   密码yemingyu  ,其他管理员名称和密码一样 例如 111 222 都是管理员"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 总结\n",
    "* 数据库作用在各方各面结合的还是比较多的\n",
    "* 第一次尝试pandas结合数据库做数据分析\n",
    "* 第一次尝试做图形界面，虽然做的不美观，但是还能将就用，程序里面还有不少未解决的小bug，\n",
    "* 能解决的作者都尝试都解决了，剩下的80%应该都能靠重启解决了"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
